<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <script src="../jQuery/jquery-3.3.1.js"></script>
    <link rel="stylesheet" href="../css/login.css" type="text/css">
    <script src="../js/jquery-2.1.1.min.js"></script>
    <script src="../js/jquery.form.min.js"></script>
    <script src="../js/main.js"></script>
    <script src="../layer/layer.js"></script>

    <script>
     $.ajaxSetup({
        xhrFields: {
            withCredentials: isCrossDomain
        }
    });
    $(function () {
        var options = {
            // 规定把请求发送到那个URL
            url: mainurl+"ladminlogin",
            // 请求方式
            type: "post",
            // 服务器响应的数据类型
            dataType: "json",
            beforeSubmit: function (formData, jqForm, options) {
                for(i=0; i<formData.length; i++) {
                    if(formData[i].value==''){
                        warnInfo("用户名或密码不能为空");
                        return false;
                    }
                }
                return true;
            },
            // 请求成功时执行的回调函数
            success: function(data, status, xhr) {
                if(checkData(data)) {
                    successInfo("登录成功");

                    if(data.data.power==1){
                        window.location.href='../root/root.html';

                    }else{
                        window.location.href='admin.html';
                    }

                }
            }
        };
        $("#ajForm").ajaxForm(options);
    });
    </script>

</head>
<body>
<div class="bgi">
    <div class="nav">
        <table class="tb1">
            <tr>
                <td><img class="img1" src="../img/hbwl.png"></td>
                <td class="title1"> 湖北文理学院全面服务襄阳对接平台后台管理系统 </td>
            </tr>

        </table>
    </div>
    <div class="biaodan">

        <form method="post" id="ajForm">
            <p class="login">登 &nbsp;&nbsp;录</p>
            <input type="text" placeholder="请输入账号" name="username" id="username">
            <br/>
            <input type="password" placeholder="请输入密码" name="password" id="password" >
            <br/>
            <br/>
            <!--<button class="btn" id="btn_submit" ><a id="btn_a" href="">点击登录</a></button>-->
            <a id="btn_a" href=""><input type="submit" class="btn" id="btn_submit" value="登录"/></a>
            <br/>
            <p class="p_left"><a href="#">记住此账号</a></p>
            <p class="p_right"><a href="#">新用户?点击注册</a></p>
        </form>
    </div>
    <div class="bottom">©2018  版权所有：湖北文理学院</div>
</div>

</body>
</html>